package com.hafiery.sdk.bluetooth;

import android.bluetooth.BluetoothDevice;
import com.hafiery.sdk.bluetooth.transport.callback.CallBackHandler;
import com.hafiery.sdk.bluetooth.transport.callback.Callback;
import com.hafiery.sdk.bluetooth.transport.req.RequestData;

import java.util.UUID;

public interface IBlueToothAction {
    void setBlueToothActionListener(IBlueToothActionListener blueToothActionListener);
    /**Whether to support
     * @return true or false
     */
    boolean isSupported();

    /**Whether to open
     * @return true or false
     */
    boolean isEnabled();

    boolean isNewCard();

    /** open the bluetooth device
     * @return true or false
     */
    boolean enable(boolean open);


    void startScan();

    /** search bluetooth device
     * @return true or false
     */
    void startScan(int timeInSeconds);

    /** stop the search of bluetooth device
     * @return true or false
     */
    void stopScan();

    /** connect to bluetooth device
     *  @param bluetoothDevice
     * @param autoConnect auto connect until the bluetooth device is connected
     * @return true or false
     */
    void connect(BluetoothDevice bluetoothDevice,boolean autoConnect);

    void connect(BluetoothDevice bluetoothDevice);

    /**
     * disconnect bluetooth device
     */
    void disconnect();

    /**
     * return bluetooth device connect status
     */
    boolean isConnected();

    boolean isScanning();

    /**
     * write date to target bluetooth device
     */
    <T> void write(RequestData requestData, CallBackHandler<T> myCallBack);
}
